package com.cy.pj.sys.controller;

import com.cy.pj.common.pojo.JsonResult;
import com.cy.pj.common.pojo.PageObject;
import com.cy.pj.sys.pojo.SysLog;
import com.cy.pj.sys.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;//业务接口对象引用

    @DeleteMapping("/log/doDeleteObjects/{ids}")
    public JsonResult doDeleteObjects(@PathVariable Integer... ids){
        sysLogService.deleteObjects(ids);
        return new JsonResult("delete ok");
    }

    @GetMapping("/log/doFindPageObjects")
    public JsonResult dofindPageObjects(@RequestParam(required = false) String username, Integer pageCurrent){

        PageObject<SysLog> pageObject=sysLogService.findPageObjectsss(username,pageCurrent);

        return new JsonResult(pageObject);//封装正确响应结果

    }

}
